<?php

/**
 * WishesController
 *
 * @author
 * @version
 */
class Tender_Join_WishesController extends Agitum_Controller_Action
{
	protected $_redirector = null;

	public function init() {
		$this->_redirector = $this->_helper->getHelper('Redirector');
	}

	public function indexAction()
	{
		$form = $this->_helper->formLoader('Wishes');
		if ( $this->_request->isPost() ) {
			$params = $this->_request->getPost();
			if ( $form->isValid($params) ) {
				$wishes = new Zend_Session_Namespace('tender/wishes');
				foreach ( $params as $key => $value ) {
					$wishes->$key = $value;
				}
				$this->_redirector->gotoUrl('/tender/contact');
			}
		}
		$this->view->form = $form;
	}
}
